-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add custom_api directory with create and update #272
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing pub mod custom_api
in src\endpoints\admin\mod.rs
.
// Build a vector of FieldElement from the comma separated contracts string | ||
let parsed_contracts: Vec<FieldElement> = body | ||
.contracts | ||
.split(",") | ||
.map(|x| FieldElement::from_str(&x).unwrap()) | ||
.collect(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part is unused
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very little change!
src/endpoints/mod.rs
Outdated
@@ -17,3 +17,4 @@ pub mod leaderboard; | |||
pub mod quest_boost; | |||
pub mod quests; | |||
pub mod unique_page_visit; | |||
pub mod custom_api; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not the right mod. There i a mod.rs in each folder. This is to indicate rust all the dependency tree. Every time, when adding a folder or a file, we need to update the mod.rs that is in the same directory. In your case, you added your folder in src\endpoints\admin
, so you have to update src\endpoints\admin\mod.rs
pub mod create_custom_api; | ||
pub mod update_custom_api; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here this mod.rs is setup perfectly
Also, I suggest you to try installing cargo so that you can try compiling or running the project, because all these issues are compiling issues, not even runtime issues |
Noted, sorry, an oversight from my own end, Thank you ser. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Working really well! Lgtm
completed the task by adding the
custom_api
directory and setting up thePOST
andPUT
method for it. Also, added theapi_url
andregex
fields to theQuestTaskDocument
in themodels.rs
file. Also made changes to all the files using theQuestTaskDocument
to include theapi_url
and theregex
fields, setting their values as None, since they are not needed in those other context, at least in this scope. I also did this to remove likely errors that might emanate from those files due to the changes I made to theQuestTaskDocument
model in themodels.rs
file.